<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta
            name="viewport"
            content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
        />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
        <title>Document</title>
        <style></style>
    </head>
    <body>
        <div id="root">
            <div :style="boxStyle">这是一个盒子</div>
            <div :style="[box1, box2, box3]">这也是一个盒子</div>
        </div>
        <script>
            const vm = new Vue({
                el: "#root",
                data() {
                    return {
                        boxStyle: {
                            color: "skyblue",
                            fontSize: "40px",
                            fontWeight: "bold",
                        },
                        box1: { color: "yellowgreen" },
                        box2: { fontSize: "80px" },
                        box3: { fontWeight: "bold" },
                    };
                },
            });
        </script>
    </body>
</html>
